//
//  BQTodayView.m
//  Adorable_Things
//
//  Created by ybq on 16/1/11.
//  Copyright © 2016年 Banana Inc. All rights reserved.
//

#import "BQTodayView.h"

@implementation BQTodayView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // 主图
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kWidth - 30, kWidth / 1.74)];
        _imageView.image = [UIImage imageNamed:@"placeHolder-1"];
        [self addSubview:_imageView];
        
        _title = [[UILabel alloc] initWithFrame:CGRectMake(15, _imageView.bottom + 15, 200, 15)];
        _title.font = [UIFont systemFontOfSize:16];
        [self addSubview:_title];
        
        _subtitle = [[UILabel alloc] initWithFrame:CGRectMake(15, _title.bottom + 7, 130, 10)];
        _subtitle.font = [UIFont systemFontOfSize:12];
        _subtitle.textColor = [UIColor lightGrayColor];
        [self addSubview:_subtitle];
        // 喜欢按钮
        _likeButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _likeButton.frame = CGRectMake(kWidth - 30 - 35, _imageView.bottom + 25, 20, 17);
        [_likeButton setImage:[UIImage imageNamed:@"iconfont-tubiao"] forState:(UIControlStateNormal)];
        [self addSubview:_likeButton];
        // 喜欢数
        _likeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_likeButton.frame.origin.x - 5, _likeButton.bottom + 5, 30, 10)];
        _likeLabel.textAlignment = NSTextAlignmentCenter;
        _likeLabel.font = [UIFont systemFontOfSize:10];
        _likeLabel.textColor = [UIColor lightGrayColor];
        [self addSubview:_likeLabel];
    }
    return self;
}

@end
